import {tableOptBtnConfig} from "../table";
import {commonConfig} from '@/config/common';
import {tableTextColumnMap} from "@/utils";

export default {
  "tableId": "analyzeFunc",
  "name": "自定义函数",
  "columns": [
    {
      label: '自定义函数编号',
      children: [
        {
          key: 'analyzeFuncNo',
        },
      ]
    },
    {
      label: '自定义函数名',
      children: [
        {
          key: 'name',
        },
      ],
    },
    {
      label: '函数类型',
      children: [
        {
          key: 'type',
          mapFunc: (data) => tableTextColumnMap(data, commonConfig.analyzeFuncType)
        },
      ],
    },
    {
      label: '备注',
      children: [
        {
          key: 'remarks',
        }
      ],
    },
    {
      label: '更新时间',
      width: 100,
      children: [
        {
          updatedDate: true
        }
      ],
    },
    {
      "label": "操作",
      "operation": true,
      "width": 150,
      "children": [
        {
          "button": true,
          type: tableOptBtnConfig.edit.type,
        },
        {
          "button": true,
          type: tableOptBtnConfig.delete.type,
          class: 'hover-danger',
        }
      ]
    }
  ],
  "filters": [
    {
      "fieldType": "string",
      key: 'type',
      label: '函数类别',
      options: [
        {label: '编码', value: 'encode'},
        {label: '解码', value: 'decode'},
        {label: '其他', value: 'others'},
      ]
    },
    {
      "fieldType": "input",
      key: 'name',
      label: '函数名',
    },
    {
      "fieldType": "input",
      key: 'remarks',
      label: '备注',
    },
  ]
}
